/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sampleEntity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author ASUS K43E
 */
@Embeddable
public class BookRoomPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "roomId", nullable = false, length = 50)
    private String roomId;
    @Basic(optional = false)
    @Column(name = "orderDate", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date orderDate;

    public BookRoomPK() {
    }

    public BookRoomPK(String roomId, Date orderDate) {
        this.roomId = roomId;
        this.orderDate = orderDate;
    }

    public String getRoomId() {
        return roomId;
    }

    public void setRoomId(String roomId) {
        this.roomId = roomId;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (roomId != null ? roomId.hashCode() : 0);
        hash += (orderDate != null ? orderDate.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BookRoomPK)) {
            return false;
        }
        BookRoomPK other = (BookRoomPK) object;
        if ((this.roomId == null && other.roomId != null) || (this.roomId != null && !this.roomId.equals(other.roomId))) {
            return false;
        }
        if ((this.orderDate == null && other.orderDate != null) || (this.orderDate != null && !this.orderDate.equals(other.orderDate))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sampleEntity.BookRoomPK[roomId=" + roomId + ", orderDate=" + orderDate + "]";
    }

}
